/*
 * @Author: PC9527\Jack sophia2152@qq.com
 * @Date: 2023-08-03 17:35:10
 * @LastEditors: PC9527\Jack sophia2152@qq.com
 * @LastEditTime: 2023-08-10 09:03:36
 * @Description:
 */
import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';

const system: AppRouteModule = {
  path: '/system',
  name: 'System',
  component: LAYOUT,
  redirect: '/system/admin',
  meta: {
    orderNo: 2000,
    icon: 'ion:settings-outline',
    title: t('routes.demo.system.moduleName'),
  },
  children: [
    {
      path: '/admin',
      name: 'AdminManagement',
      meta: {
        title: t('routes.demo.system.account'),
        ignoreKeepAlive: false,
      },
      component: () => import('/@/views/system/admin/index.vue'),
    },
    {
      path: 'admin_detail',
      name: 'AdminDetail',
      meta: {
        hideMenu: true,
        title: t('routes.demo.system.account_detail'),
        ignoreKeepAlive: true,
        showMenu: false,
        currentActiveMenu: '/system/admin',
      },
      component: () => import('/@/views/system/admin/AdminDetail.vue'),
    },
    {
      path: 'role',
      name: 'RoleManagement',
      meta: {
        title: t('routes.demo.system.role'),
        ignoreKeepAlive: true,
      },
      component: () => import('/@/views/system/role/index.vue'),
    },
    {
      path: 'menus',
      name: 'MenusManagement',
      meta: {
        title: t('routes.demo.system.menu'),
        ignoreKeepAlive: true,
      },
      component: () => import('/@/views/system/menus/index.vue'),
    },
    // {
    //   path: 'dept',
    //   name: 'DeptManagement',
    //   meta: {
    //     title: t('routes.demo.system.dept'),
    //     ignoreKeepAlive: true,
    //   },
    //   component: () => import('/@/views/demo/system/dept/index.vue'),
    // },

    {
      path: 'logs',
      name: 'LogsManagement',
      redirect: '/system/log',
      //component: getParentLayout('TableDemo'),
      meta: {
        title: '安全维护',
      },
      children: [
        {
          path: 'log',
          name: 'LogManagement',
          component: () => import('/@/views/system/log/log/index.vue'),
          meta: {
            title: '系统日志',
          },
        },
        {
          path: 'loginlog',
          name: 'LoginLogManagement',
          component: () => import('/@/views/system/log/login_log/index.vue'),
          meta: {
            title: '登录日志',
          },
        },
      ],
    },

    // {
    //   path: '/error-log',
    //   name: 'ErrorLog',
    //   component: () => import('/@/views/sys/error-log/index.vue'),
    //   meta: {
    //     title: t('routes.demo.feat.errorLog'),
    //   },
    // },
  ],
};

export default system;
